package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.dto.MeberOrderProjectDto;
import com.zzyl.nursing.service.IMemberOrdersProjectService;
import com.zzyl.serve.domain.NursingProject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
public class MemberOrdersProjectController extends BaseController {

    @Autowired
    private IMemberOrdersProjectService memberOrdersProjectService;
    @GetMapping("/page")
    @ApiOperation(value = "分页获取项目订单列表")
    public TableDataInfo<List<NursingProject>> page(MeberOrderProjectDto dto) {
        TableDataInfo list = memberOrdersProjectService.selectNursingProjectList(dto);
        return getDataTable(list) ;
    }


    @GetMapping("/{id}")
    @ApiOperation(value = "根据编号·获取项目订单详情")
    public AjaxResult getById(@PathVariable Long id) {
        NursingProject nursingProject = memberOrdersProjectService.getById(id);
        return AjaxResult.success(nursingProject);
    }



}
